<jsp:useBean id="sessiondata" class="bibbletex.models.SessionData"
	scope="session" />

<%@ page
	import="bibbletex.models.*,java.util.UUID,java.util.List"
	import="bibbletex.views.CollaborationView,bibbletex.controllers.CollaborationController" %>	

<%
	String page_title;
	String onloadjsfunction="";
	Collaboration c = null;
	String id_parameter = request.getParameter("cid");
	boolean show_library = true;
	boolean show_navigation = false;
	String message = "";
	String[] jstitle={"collab"};
	
	page_title = new String("Delete Collaboration");
	
	if (id_parameter == null && sessiondata.collaboration == null)
	{
		message = new String("The collaboration could not be deleted.");
	}
	else if (sessiondata.collaboration_is_editable)
		c = sessiondata.collaboration;
	else if (id_parameter != null && Collaboration.id_is_private(id_parameter))
		c = CollaborationController.load(id_parameter);
	else
		message = new String("You do NOT have right to do that.");
		
	if (c != null)
	{
		boolean result = CollaborationController.delete(c);
		if (result)
			message = new String("Collaboration successfully deleted.");
		else
			message = new String("The collaboration could not be deleted.");
	}

%>

<%!	boolean show_title = true; %>
<%@ include file="/header.jsp"%>
<div id="Content">
	<div id="ContentCenter" class="clearfix">

<h4 class="headLine"><%=message%></h4>


	<a class="indexLink" href="/">
		Return to the index
	</a>

</div>
</div>

<%@ include file="/footer.jsp"%>
